﻿'===================================================================================
'功能說明:執行代職務的系統功能
'建立人員: andy
'建立日期：2011/8/24
''===================================================================================
Imports System.Data
Partial Class WFRunAgent

    Inherits BasePage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            hiUID.Value = ActualUID
            hiDBName.Value = dbName
           
        End If


    End Sub

  
    Protected Sub btnRunAgent_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ''執行代理
        Dim RunUID As String = CType(sender, Button).CommandArgument.ToString
        Dim UDao As OAMS.DAO.UsersDAO = New OAMS.DAO.UsersDAO(hidbName.Value)

        
        Try
            Dim dr As DataRow = UDao.GetEmpData(RunUID).Rows(0)
            UID = dr("emp_no").ToString
            UserName = dr("emp_name").ToString

            Dim path As String = Me.ResolveUrl("~/WebForm/Main/MainPage.aspx")
            RunClientScriptForAjax(Page, "parent.parent.window.top.location='" + path + "';")
        Catch ex As Exception

        End Try


    End Sub
End Class
